<template>
    <div class="my common__color-F0F0F0">
        <x-header v-show="!isWeChar">
            <div slot="default" class="common__header--title">保险条款</div>
            <div @click="goBack" slot="overwrite-left"><img slot="icon" src="~assets/x3/ico/goback1.png" class="go-back"></div>
        </x-header>
        <group>
            <cell @click.native="myLink(clause)" v-for="(clause,index) in clauseStore.curClauseTitleList" :key="index" is-link>
                <span class="my__list--title" slot="after-title">{{clause}}</span>
            </cell>
        </group>
    </div>
</template>

<script>
import { PopState, FooterIndex, Mutations, RouteUrl, FooterShow } from "src/common/const";
import { XHeader, Group, Cell, CellBox, Badge, XInput, XDialog, XButton, XSwitch, TransferDomDirective as TransferDom } from "vux";
import { mapState, mapActions } from "vuex";
import { RequestUrl } from "src/common/url";
export default {
    directives: {
        TransferDom
    },
    components: { XInput, XHeader, Group, Cell, CellBox, Badge, XDialog, XButton, XSwitch },
    computed: mapState(["region", "user", "initUrl", "saveInsure", "isWeChar", "clauseStore"]),
    data() {
        return {

        };
    },
    methods: {
        myLink(clause) {
            let query = {
                title: clause,
                _this: this
            };
            this.$store.commit(Mutations.GET_CLAUSE_STORE_ITEM, query);
            // let activity = {
            //     activityDiv: menu.detail,
            //     activityName: clause,
            // }
            // // _this.$store.commit(Mutations.FOOTER_SHOW, FooterShow.FALSE);
            // this.$store.commit(Mutations.AD_ACTIVITY, activity);
            // this.$common.goUrl(this, RouteUrl.AD_ACTIVITY);
        },
        goBack() {
            this.$common.goBack(this);
        },
    },
    beforeRouteEnter(to, from, next) {
        sessionStorage["CLAUSE_FORM_URL"] = from.path;
        next();
    },
    beforeMount() {
        if (sessionStorage["CLAUSE_FORM_URL"] == "/") {
            this.$common.goUrl(this, RouteUrl.DETAILS);
        }
    },
    mounted() {
        document.title = "保险条款";
        this.$store.commit(Mutations.FOOTER_SHOW, FooterShow.FALSE);
        // this.$init.indexInit(this, FooterIndex.MY);
        // 初始化页面数据
        this.$init.subPageInit(this);
    }
};
</script>


<style lang="scss">
.my {
  width: 100%;
}

//头像父级的DIV
.my__head {
  width: 64px;
  height: 64px;
}

.my__header--img {
  width: 64px;
  height: 64px;
  border-radius: 100%;
}

// .weui-cells {
//     margin-top: 10px !important;
// }
.my__user--name {
  font-size: 15px;
  margin-left: 4px;
}

.my__user--type {
  height: 21px;
  line-height: 21px;
  font-size: 12px;
  color: #7f7f7f;
}

.my__user--typeimg {
  float: left;
  margin-top: 3px;
  margin-left: 8px;
  margin-right: 5px;
  width: 15px;
  height: 15px;
}

.my__list--title {
  font-size: 15px;
}

.my__list--right {
  font-size: 12px;
}

.my__list--rightfont {
  font-size: 15px;
  color: #7f7f7f;
}
</style>







